﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace viBook.Models
{
    public class Book
    {
        public int Id { set; get; }

        [Required]
        public string Title { set; get; }

        [Required]
        public int AuthorId { set; get; }

        public string Description { set; get; }
        public int View { set; get; }
        public string CoverUrl { set; get; }

        [Required]
        public DateTime UploadedDate { set; get; }

        [Required]
        public int UploadedBy { set; get; }

        public string Tag { set; get; }

        [Required]
        public int CategoryId { set; get; }

        public bool HasChapters { set; get; }

        public virtual IEnumerable<BookComment> Comments { get; set; }
        public virtual IEnumerable<ContentTag> ContentTags { get; set; }
        public virtual IEnumerable<Chapter> Chapters { get; set; }

        public int NumberOfPage { set; get; }

        [Required]
        public string AuthorName { set; get; }

        public int NumberOfComments { get; set; }
        public int NumberOfLikes { get; set; }
        public int NumberOfViews { get; set; }

        [Required]
        public string Uploader { set; get; }

        public virtual int NumberOfChapters { get; set; }
    }
}